package com.ykzb.talent.controller;

import com.ykzb.base.bean.ResultBean;
import com.ykzb.base.exception.BusinessException;
import com.ykzb.constants.Constants;
import com.ykzb.constants.UrlConstants;
import com.ykzb.enums.MsgEnumType;
import com.ykzb.enums.SSDBKeys;
import com.ykzb.redis.RedisClient;
import com.ykzb.talent.service.ITalentService;
import com.ykzb.user.model.User;
import com.ykzb.user.service.UserService;
import com.ykzb.util.RSACoder;
import com.ykzb.util.RSAKey;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletRequest;
import java.util.Date;

/**
 * Created by mac on 2017/4/7.
 */
@Controller
@RequestMapping("/talent")
public class TalentController {

    protected Log log = LogFactory.getLog(this.getClass().getName());

    @Autowired
    private ITalentService talentService;

    /**
     * 用户手机号注册
     * @param code
     * @param user
     * @return
     */
    @RequestMapping(value = UrlConstants.USER_REGISTER_TALENT,method ={RequestMethod.GET,RequestMethod.POST})
    @ResponseBody
    public ResultBean register(HttpServletRequest request, String code, User user) throws  Exception{
         ResultBean ret = talentService.registerTalent(request,code,user);
         return  ret;
    }

}
